/*

package com.xiaoluyy.demo.config;

import com.xiaoluyy.common.beanstalkd.client.BeanstalkdClient;
import com.xiaoluyy.common.beanstalkd.client.BeanstalkdClientPool;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;


*/
/**
 * beanstalkdclient configuration
 *//*



@Configuration
public class BeanstalkClientConfig {

    @Value("${beanstalkd.addr}")
    String serverAddr;

    @Value("${beanstalkd.connecttimeout}")
    Integer connectTimeout;

    @Value("${cavNotify.tube}")
    private String cavNotifyTube;

    @Bean(name = "beanstalkdClient")
    public BeanstalkdClient beanstalkdClient() {

        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClient client = new BeanstalkdClient(servers, connectTimeout);
        return client;
    }

    @Bean(name = "shopInsertClientPool")
    public BeanstalkdClientPool shopInsertClientPool() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, "ownerInsert");
        return beanstalkdClientPool;
    }

    @Bean(name = "shopUpdateClientPool")
    public BeanstalkdClientPool shopUpdateClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, "ownerUpdate");
        return beanstalkdClientPool;
    }

    @Bean(name = "shopDeleteClientPool")
    public BeanstalkdClientPool shopDeleteClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, "ownerDelete");
        return beanstalkdClientPool;
    }

    @Bean(name = "itemInsertClientPool")
    public BeanstalkdClientPool itemInsertClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, "marketInsert");
        return beanstalkdClientPool;
    }

    @Bean(name = "itemUpdateClientPool")
    public BeanstalkdClientPool itemUpdateClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, "marketUpdate");
        return beanstalkdClientPool;
    }

    @Bean(name = "itemDeleteClientPool")
    public BeanstalkdClientPool itemDeleteClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, "marketDelete");
        return beanstalkdClientPool;
    }

    @Bean(name = "couponPushClientPool")
    public BeanstalkdClientPool couponPushClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, "couponPush");
        return beanstalkdClientPool;
    }

    @Bean(name = "couponCavClientPool")
    public BeanstalkdClientPool couponCavClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, "couponStatusChanged");
        return beanstalkdClientPool;
    }

    @Bean(name = "couponCavClientPool4CarServ")
    public BeanstalkdClientPool couponCavCarServClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool=new BeanstalkdClientPool(servers, "couponStatusChanged4CarServ");
        return beanstalkdClientPool;
    }

    @Bean(name = "cavNotifyClientPool")
    public BeanstalkdClientPool cavNotifyClientPool() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        Set<String> watchedTubes = new HashSet<>();
        watchedTubes.add(cavNotifyTube);
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, watchedTubes);
        return beanstalkdClientPool;
    }

    @Bean(name = "cavNotifyProdClientPool")
    public BeanstalkdClientPool cavNotifyProdClientPool() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool = new BeanstalkdClientPool(servers, cavNotifyTube);
        return beanstalkdClientPool;
    }
    
    @Bean(name = "couponCavClientPool4CarProduct")
    public BeanstalkdClientPool couponCavCarBrandClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool=new BeanstalkdClientPool(servers, "couponStatusChanged4CarProduct");
        return beanstalkdClientPool;
    }

    @Bean(name = "couponCavClientPool4CarFinance")
    public BeanstalkdClientPool couponCavCarFinanceClient() {
        ArrayList<String> servers = new ArrayList<String>(Arrays.asList(serverAddr.split(",")));
        BeanstalkdClientPool beanstalkdClientPool=new BeanstalkdClientPool(servers, "couponStatusChanged4CarFinance");
        return beanstalkdClientPool;
    }
}

*/
